#ifndef WORK_DATA_PROXY_H
#define WORK_DATA_PROXY_H

#include <sdbus-c++/sdbus-c++.h>
#include <string>
#include <thread>

class WorkDataProxy
{
  public:
    WorkDataProxy();
    virtual ~WorkDataProxy();
    long CreateTask(std::string name);
    void DeleteTask(long task_id);
    std::vector<std::string> GetTaskNameList();
    std::vector<long> GetTaskIDList();
    std::vector<long> GetRecordID(long rec_id);
    std::tuple<long,long,std::string,bool,bool> GetRecordInf(long);
    long CreateRecord(long task_id,long stu_id);
    void LoadTaskInf();
    void FinishRecord(long rec_id);
    bool OutputData(long rec_id,std::string path);
    std::string GetRecordPath(long rec_id);
    std::string GetStudentInfo(long stu_id);
    std::vector<long> GetRecordHandleFinishList();
    std::vector<long> GetRecordHandleFinishListWithTask(long taskid);
    std::tuple<std::string,std::string> GetTaskInf(long task_id);
  private:
    std::unique_ptr<sdbus::IConnection> sessionConn;
    std::unique_ptr<sdbus::IProxy> proxy;
    const char* InterFaceName="org.HBTY.WorkDataManager";
};

#endif
